home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 412 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.5 KB  |  57 lines

  1. Path: chronicle.mti.sgi.com!austern
  2. From: jason@cygnus.com (Jason Merrill)
  3. Newsgroups: comp.std.c++
  4. Subject: Re: default template args in a typedef
  5. Date: 20 Feb 1996 10:56:51 PST
  6. Organization: Cygnus Support, Mountain View, CA
  7. Approved: austern@isolde.mti.sgi.com
  8. Message-ID: <u9wx5i5kyw.fsf@yorick.cygnus.com>
  9. References: <4g5ddd$56t@cnn.Princeton.EDU>
  10. NNTP-Posting-Host: isolde.mti.sgi.com
  11. X-Original-Date: 20 Feb 1996 02:51:03 -0800
  12. In-Reply-To: tim@franck.Princeton.EDU's message of 19 Feb 96 02:23:48 GMT
  13. X-Newsreader: Gnus v5.0
  14. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  15.     iQBVAwUBMSoZk0y4NqrwXLNJAQGiHAIAyhiOIXXdXcMG+8Xn0dRDaXjK0NDJJMlB
  16.     8ER9jp6tYRhkS9Bk097GjTuGkFNJVkk2UC5w4WUwZjvGXCUfobpbVw==
  17.     =HgVE
  18. Originator: austern@isolde.mti.sgi.com
  19.  
  20. >>>>> Tim Hollebeek <tim@franck.Princeton.EDU> writes:
  21.  
  22. > Is this legal?
  23. > -------
  24. > template <class T>
  25. > class X {
  26. > };
  27.  
  28. > template <class T, class U = X<T> >
  29. > class Y {
  30. > };
  31.  
  32. > typedef Y<double, X<double> > Z1;
  33. > typedef Y<double> Z2;
  34.  
  35. > int main() {
  36. >     Z1 z1;
  37. >     Z2 z2; // <--- here
  38. > }
  39. > -------
  40.  
  41. > g++ 2.7.2 doesn't mind Z1, but gives:
  42.  
  43. > aggregate `Y<...> z2' has incomplete type and cannot be initialized
  44.  
  45. > on the Z2 line.
  46.  
  47. This is a bug in g++ 2.7.2.
  48.  
  49. Jason
  50. ---
  51. [ To submit articles: Try just posting with your newsreader.  If that fails,
  52.                       use mailto:std-c++@ncar.ucar.edu
  53.   FAQ: http://reality.sgi.com/employees/austern_mti/std-c++/faq.html
  54.   Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html
  55.   Comments? mailto:std.c++-request@ncar.ucar.edu 
  56. ]
  57.